# coding: UTF-8
# ----------
# Project_Name : pythonProject
# File_Name : huangcongbing
# Author : asus
# Date_Time:2022/4/27 14:11
# Description :
# ----------
import unittest  # 导入测试框架

from selenium import webdriver
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait  # 导入显式等待类
from selenium.webdriver.support import expected_conditions  # 导入等待条件
from selenium.webdriver.common.action_chains import ActionChains

class zhyzptest(unittest.TestCase):  #必须继承Tescase
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.wait = WebDriverWait(self.driver,30)
        self.driver.maximize_window()
        self.driver.get("http://192.168.2.6/cloud/#/my")

    def test(self):
        #登录
        self.wait.until(expected_conditions.visibility_of_element_located((By.XPATH,'//*[@id="account"]/input')))
        self.driver.find_element(By.XPATH,'//*[@id="account"]/input').send_keys("admin")
        self.driver.find_element(By.XPATH,'//*[@id="password"]/input').send_keys("123456")
        self.driver.find_element(By.XPATH,'//*[@id="authCode"]/div/input').send_keys("8888")
        self.driver.find_element(By.XPATH,'//*[@id="root"]/div/div[1]/form/div[5]/div/div').click()
        time.sleep(2)
        #招聘管理--数据录入
        # self.wait.until(expected_conditions.visibility_of_element_located('//*[@id="root"]/section/aside/div/ul/li[1]/div')))
        self.driver.find_element(By.XPATH,'//*[@id="root"]/section/aside/div/ul/li[1]/div').click()#点击招聘管理
        time.sleep(2)
        self.driver.find_element(By.XPATH,'//*[@id="sale$Menu"]/li[5]').click()  #点击数据录入
        self.driver.find_element(By.CLASS_NAME,'ant-card-body').click()#点击手工添加

        #录入信息
        self.driver.find_element(By.ID,'name').send_keys('哇哈哈')#输入姓名
        self.driver.find_element(By.ID,'sex').click()#点击性别
        self.driver.find_element(By.XPATH,'//ul/li[text()="男"]').click()#点击性别男
        self.driver.find_elements(By.CLASS_NAME,'ant-select-selection__rendered')[4].click()
        time.sleep(2)
        self.driver.find_element(By.ID,'priority').click()#点击优先级
        self.driver.find_element(By.XPATH,'//ul/li[text()="高"]').click()#选择优先级为  高
        self.driver.find_element(By.XPATH,'//*[@id="channelId"]/div/div').click()#  点击渠道
        self.wait.until(
            expected_conditions.visibility_of_element_located((By.XPATH,'//ul/li[text()="投递简历"]')))
        self.driver.find_element(By.XPATH,'//ul/li[text()="投递简历"]').click()#选择的建立渠道为投递简历

        self.driver.find_element(By.XPATH,'//ul/li[text()="拉勾网"]').click()#来源途径为：拉勾网
        self.driver.find_element(By.XPATH, '//*[@id="trainType"]/div/div').click()#产品线







